package com.zhudi.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 用户信息表
 * @TableName user
 */
@TableName(value ="user")
@Data
public class User implements Serializable {
    /**
     * id
     */
    @TableId(value = "id",type = IdType.AUTO)
    private int id;

    /**
     * 用户名
     */
    @TableField("user_name")
    private String userName;

    /**
     * 密码

     */
    private String password;

    /**
     * 昵称
     */
    private String nickname;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 头像
     */
    private String avatar;



    /**
     * 身份，0表示普通用户，1表示管理员
     */
    private Integer role;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 逻辑删除。0表示未删除，1表示已删除
     */
    @TableLogic
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    public User() {
    }
    public User(String userName, String password, String nickname, String phone, String avatar, Integer role) {
        this.userName = userName;
        this.password = password;
        this.nickname = nickname;
        this.phone = phone;
        this.avatar = avatar;
        this.role = role;

    }

    public User(String userName, String password) {
        this.userName = userName;
        this.password = password;

    }
    public User(Integer id) {
        this.id = id;

    }

    public User(Integer id, String userName, String password, String nickname, String phone, String avatar, Integer role, Date createTime, Date updateTime, Integer isDelete) {
        this.id = id;
        this.userName = userName;
        this.password = password;
        this.nickname = nickname;
        this.phone = phone;
        this.avatar = avatar;
        this.role = role;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.isDelete = isDelete;
    }

    public User(Integer id, String userName, String password, String nickname, String phone, String avatar) {
        this.id = id;
        this.userName = userName;
        this.password = password;
        this.nickname = nickname;
        this.phone = phone;
        this.avatar = avatar;
        this.role = 0;
        this.isDelete = 0;
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public Integer getRole() {
        return role;
    }

    public void setRole(Integer role) {
        this.role = role;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }
}